home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 4 / Apprentice-Release4.iso / Source Code / Libraries / C Internet Config / Examples ƒ / ICHelloCruelWorld / IC Hello Cruel World.c next >
Encoding:
C/C++ Source or Header  |  1995-11-18  |  795 b   |  39 lines  |  [TEXT/SPM ]

  1. /*
  2.     IC Hello Cruel World.c
  3.     
  4.     The simplest IC aware program.  It simply outputs Real Name preference,
  5.     which is assumed to contain the text "\pHello Cruel World!"
  6. */
  7.  
  8. #include <stdio.h>
  9. #include <stdlib.h>
  10.  
  11. #include "IC Types.h"
  12. #include "IC API.h"
  13. #include "IC Keys.h"
  14.  
  15. int main(){
  16.     ICInstance instance;
  17.     Str255 str;
  18.     long str_size;
  19.     ICAttr attr;
  20.     
  21.     printf("Hello Cruel World Test\n");
  22.     
  23.     if (ICStart(&instance,'????')==noErr){
  24.         if (ICFindConfigFile(instance,0,NULL)==noErr){
  25.             Str255 temp=kICRealName;
  26.             
  27.             str_size=sizeof(Str255);
  28.             
  29.             if (ICGetPref(instance,temp,&attr,(Ptr)str,&str_size)==noErr)
  30.                 printf("Real name is %#s\n",str);
  31.             else
  32.                 printf("ICGetPref Error\n");
  33.         } else
  34.             printf("ICFindConfigFile error\n");
  35.         
  36.         ICStop(instance);
  37.     } else
  38.         printf("ICStart error\n");
  39. }